package com.niit.springbootshop.entity;

/**
 * 存放购物车列表中 每一行具体的信息
 * @author Admin
 *
 */
public class CartItem {
	private Product product; // 商品信息(图片，描述，价格)
	private int quantity;    // 购买的数量
	private double subTotal;    // 小计金额    (需要通过计算得到)
	
	public Product getProduct() {
		return product;
	}
	public void setProduct(Product product) {
		this.product = product;
	}
	public int getQuantity() {
		return quantity;
	}
	public void setQuantity(int quantity) {
		this.quantity = quantity;
	}
	public double getSubTotal() { // 计算下 小计金额
		subTotal = quantity*product.getShopPrice();
		return subTotal;
	}
	public void setSubTotal(double subTotal) {
		this.subTotal = subTotal;
	}
}
